O1b-1b: make terminal stamps fixed values - #480
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughИзменены контракты stamp для point-sink, retirement-состояние ChangesPoint attachment и тестовые проверки
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/labcolors-core/src/program/attachment/support.rs`:
- Around line 184-199: Replace the panic-based failures in
checkpoint_next_terminal_tail and in_memory_point_sink with typed
InMemoryPointSinkErrorV1 results: return the appropriate error when a
terminal-tail checkpoint overlaps and when NEXT_TEST_SINK_EPOCH is exhausted.
Update these crate-visible APIs and their callers to propagate or handle the
Result while preserving successful behavior.
In `@crates/labcolors-core/src/test_support.rs`:
- Around line 70-92: Измените reset_allocator_events и current_allocator_events
так, чтобы отсутствие активного измерения возвращало типизированную
AllocatorMeasurementError вместо panic через
assert_allocator_measurement_is_active. Обновите вызывающий путь checkpoint в
sink и связанные методы для проброса этой ошибки до API-границы, не подставляя
нулевые AllocatorEvents и не скрывая ошибку.
- Around line 27-30: Update record so the COUNT_ALLOCATIONS.try_with(Cell::get)
result is handled with an explicit branch instead of unwrap_or(false). Preserve
the inactive-measurement behavior when TLS access fails, and add a concise
comment explaining that this is permitted during thread teardown under the
GlobalAlloc invariant.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 12bc8187-b0b2-4973-b463-008820cff558
📒 Files selected for processing (8)
crates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.jsoncrates/labcolors-core/contracts/clean-set-srgb8-v1/receipt-v1.sha256crates/labcolors-core/src/program/attachment.rscrates/labcolors-core/src/program/attachment/support.rscrates/labcolors-core/src/program/attachment/tests.rscrates/labcolors-core/src/test_support.rsscripts/test_verify_clean_set_receipt.pyscripts/verify_clean_set_receipt.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
Проблема
Point-sink stamp мог владеть heap-ресурсом. Из-за этого terminal commit tail требовал отдельного deferred-retirement слота, а прежний allocation gate складывал
alloc + reallocи не замечал освобождение памяти внутри проверяемого участка.Корневая причина
Контракт допускал
Stamp: Clone + Eqи возвращал proposed stamp по ссылке. Test sink закреплял epoch черезRc; allocator oracle не различалalloc,reallocиdealloc.Изменение
Stamp: Copy + Eq; proposed stamp возвращается значением.Attachment::retired_stamp.u64: sequence и auto-minted sink epoch.AtomicU64issuer исключает ручные коллизии, zero, wrap и ABA в пределах процесса.StampMismatch.alloc,alloc_zeroed,reallocиdealloc.Attachmentpost-install tail дляSetAll,RevokeAllиConfirmExactдаёт ноль всех allocator events.RED → GREEN
Проверки
cargo test --workspace --all-targets --locked: 1081 passed, 7 ignored.-D warnings, rustfmt, MSRV Rust 1.85.0,git diff --check: GREEN.369e1cf175ac10ab96ca1f6cb82e131e4c24fc43c698a0d853ccabdebb0386d5.Не входит
Здесь нет browser/CSSOM sink, публичного Program façade, WASM bridge или второго runtime authority. Следующий correctness-root — O1b-1c: typed closed absence, host codec/capability/root/sink-epoch binding и retryable cleanup там, где revoke не доказан infallible.
Summary by CodeRabbit
Улучшения
Исправления
Тесты и проверки